/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import javax.swing.JFrame;

/**
 *
 * @author Daniel
 */

//Un TFrame amb un simple rentat de cara, perquè
    //Sigui més senzill posar les bounds,
    //Obrir-lo i tancar-lo.
public class EFrame extends JFrame {

    private int _WIDTH, _HEIGHT,
            _BOXEL_WIDTH, _BOXEL_HEIGHT;
    private Rectangle _size;
    private Dimension _screen;
    private Point _location;

    public EFrame(int WIDTH, int HEIGHT,
            int BOXEL_WIDTH, int BOXEL_HEIGHT,
            Point location, String title) {
        super(title);

        this._WIDTH = WIDTH;
        this._HEIGHT = HEIGHT;
        this._BOXEL_HEIGHT = BOXEL_HEIGHT;
        this._BOXEL_WIDTH = BOXEL_WIDTH;
        this._location = location;

        _size = new Rectangle(WIDTH, HEIGHT);
        _screen = Toolkit.getDefaultToolkit().getScreenSize();

        super.setBounds(_size);
        super.setLocation(location);
        
        
        super.setResizable(false);

    }

    public void start() {
        super.setVisible(true);
        super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public void close() {
        super.setVisible(false);
        super.dispose();
    }
}
